Skip to content

fix: skip invalid images during SAM preload - #264

Merged
vietanhdev merged 1 commit into
mainfrom
fix/invalid-image-preload
Aug 30, 2026
Merged

fix: skip invalid images during SAM preload#264
vietanhdev merged 1 commit into
mainfrom
fix/invalid-image-preload

Conversation

@vietanhdev

Copy link
Copy Markdown
Owner

Fixes #69.

A failed image decode returned a null QImage from the auto-labeling helper. The SAM background preloader then passed it to qimage2ndarray, which raised the exact reported ValueError: qimageview got invalid QImage.

This change returns None after empty or invalid image data so the existing preload guard skips the file. It also adds regression coverage for corrupt and valid image files.

Validation:

  • Linux: full suite, 137 passed / 13 optional model tests skipped
  • Linux: manual corrupt-image SAM preload; encoder and cache remained untouched
  • Apple Silicon macOS: focused tests and manual corrupt-image SAM preload passed
  • Windows: focused corrupt/valid image tests passed
  • ruff check and ruff format --check passed

@vietanhdev
vietanhdev merged commit cc22783 into main Aug 30, 2026
9 checks passed
@vietanhdev
vietanhdev deleted the fix/invalid-image-preload branch August 30, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

run anythinglabeling have error ValueError("qimageview got invalid QImage"

1 participant